<?php
/**
 * Created by PhpStorm.
 * User: 24369
 * Date: 2021/6/26
 * Time: 10:56
 */
namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;

class Admin extends Model
{
    use SoftDelete;
    protected $deleteTime='delete_time';
    public static function getAdminList()
    {
        $list=Admin::alias('a')
            ->field('a.id,a.name,a.headimg,ag.title')
            ->join('auth_group_access aga','aga.uid=a.id')
            ->join('auth_group ag','ag.id=aga.group_id')
            ->paginate(5);
        return  $list;
    }
    public static function getAdminEdit($id)
    {
        $list=Admin::alias('a')
            ->field('a.id,a.name,a.headimg,ag.title,a.email,ag.id aid')
            ->join('auth_group_access aga','aga.uid=a.id')
            ->join('auth_group ag','ag.id=aga.group_id')
            ->find($id);
        return  $list;
    }
}